import java.sql.DriverManager;
import net.ucanaccess.jdbc.UcanaccessDriver;
import net.ucanaccess.jdbc.UcanaccessConnection;

public class ConexaoBancoDeDados {

    public static UcanaccessConnection getConexao() throws Exception {
        try {
            Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
            return (UcanaccessConnection)DriverManager.getConnection(UcanaccessDriver.URL_PREFIX + "c:/temp/CRUD.accdb;showschema=true;newDatabaseVersion=V2010");
        } catch (ClassNotFoundException e) {
            throw new Exception(e.getMessage());
        }
    }
}
